#include "CaenDiscriminator.h"


void CaenDiscriminator::EnableChannel(int channel)
{
  unsigned pattern = 0;
  
  channelEnabled[channel] = true;
  for (int ch = 0; ch < GetNChannels(); ch++)
    if (channelEnabled[ch])
        pattern |= (1 << ch);
  
  SetInhibitPattern(pattern);
}


void CaenDiscriminator::DisableChannel(int channel)
{
  unsigned pattern = 0;
  
  channelEnabled[channel] = false;
  for (int ch = 0; ch < GetNChannels(); ch++)
    if (channelEnabled[ch])
      pattern |= (1 << ch);
  
  SetInhibitPattern(pattern);
}

